import random
import time

def sleep(n_secs):
    time.sleep(n_secs)


def get_random_user_agent():
    user_agent = ["Mozilla/5.0 Ally","Mozilla/5.0 Ally liuyuqin","Mozilla/5.0 Ally mengmeng"]
    return random.choice(user_agent)


def get_accounts():
    # 如果要实现参数化(数据驱动)，需要返回一个嵌套字典的列表，每个字典代表一条用例
    # key为变量名，value为值
    accounts = [{"title":"正常登录","username":"keyou1","password":"123456","status_code":200,"contain_msg":"token"},
                {"title":"密码错误","username":"keyou1","password":"123457","status_code":400,"contain_msg":"non_field_errors"},
                {"title":"账号错误","username":"keyou11111","password":"123456","status_code":400,"contain_msg":"non_field_errors"},
                {"title":"用户名为空","username":"","password":"123456","status_code":400,"contain_msg":"username"},
                {"title":"正常登录","username":"keyou1","password":"","status_code":400,"contain_msg":"password"}]
    return accounts



if __name__ == '__main__':
    print(get_random_user_agent())
